import java.util.Scanner;
public class Lab04Task03 {
	public static void main(String[] args) {
		String str,str2;
		int s1,s2;
		Scanner kb=new Scanner(System.in);
		System.out.println("please enter a string consisting of 3 or more words:");
		str=kb.nextLine();
		s1 = str.indexOf(" ");
		s2=  str.lastIndexOf(" ");
		str2 = str.substring((s1+1),s2);
		System.out.print(str2);
	}
}
